home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / xdsn217.zip / ODEF / O2String.odf < prev    next >
Text File  |  1996-06-28  |  2KB  |  49 lines

  1. (** Oakwood Oberon-2 library *)
  2. (** Copyright (c) xTech 1995. All rights reserved. *)
  3. DEFINITION O2Strings;
  4.  
  5. PROCEDURE Length*(stringVal: ARRAY OF CHAR): INTEGER;
  6. (** Returns the number of characters in s up to and excluding the first 0X *)
  7.  
  8. PROCEDURE Insert*(s: ARRAY OF CHAR; pos: INTEGER; VAR d: ARRAY OF CHAR);
  9. (** Inserts the string s into the string d at position pos
  10.   (0 <= pos <= Length(d)). If pos = Length(d), s is appended to d.
  11.   If the size of d is not large enough to hold the result of operation,
  12.   the result is truncated so that d is always terminated with 0X.
  13. *)
  14.  
  15. PROCEDURE Append*(s: ARRAY OF CHAR; VAR d: ARRAY OF CHAR);
  16. (** Has the same effect as Insert(s,Length(d),d) *)
  17.  
  18. PROCEDURE Delete*(VAR s: ARRAY OF CHAR; pos,n: INTEGER);
  19. (** Deletes n characters from s starting at position pos
  20.   (0 <= pos < Length(d)). If n > Length(s)-pos, the new
  21.   length of s is pos.
  22. *)
  23.  
  24. PROCEDURE Replace*(s: ARRAY OF CHAR; pos: INTEGER; VAR d: ARRAY OF CHAR);
  25. (** Has the same effect as Delete(d,pos,Length(s)) followed by
  26.   an Insert(s,pos,d).
  27. *)
  28.  
  29. PROCEDURE Extract*(s: ARRAY OF CHAR; p,l: INTEGER; VAR d: ARRAY OF CHAR);
  30. (** Extracts a substring d with n characters from position pos
  31.   (0 <= pos < Length(s)) in s. If n > Length(s) - pos, d is only
  32.   the part of s from pos to Length(s)-1.
  33.   If the size of d is not large enough to hold the result of operation,
  34.   the result is truncated so that d is always terminated with 0X.
  35. *)
  36.  
  37. PROCEDURE Pos*(p,s: ARRAY OF CHAR; start: INTEGER): INTEGER;
  38. (** Returns the position of the first occurences of the pattern p
  39.   in s after position pos (inclusive). If p is not found, -1 is
  40.   returned.
  41. *)
  42.  
  43. PROCEDURE Cap*(VAR s: ARRAY OF CHAR);
  44. (** Replaces each lower case letter within s by its upper case
  45.   equivalent.
  46. *)
  47.  
  48. END O2Strings.
  49.